package info.ask4research.service.impl;

import java.util.List;

import javax.annotation.Resource;

import info.ask4research.dao.IRoleDAO;
import info.ask4research.dao.IUnitOfLearningDAO;
import info.ask4research.dao.core.AbstractDao;
import info.ask4research.model.UnitOfLearning;
import info.ask4research.model.User;
import info.ask4research.model.addons.Question;
import info.ask4research.model.roles.Role;
import info.ask4research.service.IQuestionService;
import info.ask4research.service.IRoleService;
import info.ask4research.service.core.impl.AbstractServiceImpl;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service(value="roleService")
@Transactional
public class RoleService extends AbstractServiceImpl<Role> implements IRoleService{
	@Resource(name = "roleDAO")
	private IRoleDAO dao;
	
	@Override
	public AbstractDao<Role> getDao() {
		return dao;
	}

	@Override
	public void setDao(AbstractDao<Role> dao) {
		this.dao = (IRoleDAO) dao;
	}
	@Override
	public List<Role> getStaffRolesByUoL(int id) {
		return dao.getStaffRolesByUoL(id);
	}
	@Override
	public List<Role> getLearnerRolesByUoL(int id) {
		return dao.getLearnerRolesByUoL(id);
	}
	@Override
	public List<Role> getRolesByUoL(int id) {
		return dao.getRolesByUoL(id);
	}
	@Override
	public boolean roleNameExists(String stringRole, Integer UoLId) {
		return dao.roleNameExists(stringRole, UoLId);
	}
	@Override
	public Role getRoleByUoFandRoleName(String stringRole, Integer UoLId) {
		return dao.getRoleByUoFandRoleName(stringRole, UoLId);
	}
	@Override
	public List<Role> getRoleListByUoL(int limit, int page,
			int start, int idUoL) {
		return dao.getRoleListByUoL( limit,  page, start,  idUoL);
	}

	@Override
	public Role getRoleByName(String manager) {
		return dao.getRoleByName(manager);
	}
	
}
